<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:rich="http://richfaces.org/rich"
    xmlns:a="http://richfaces.org/a4j"
    template="/layout/admin_template.xhtml">

    <ui:define name="body">
  		<s:fragment rendered="#{!kItemAvalableManager.error}" >
	   		<rich:panel id="e_id" >
	   			<f:facet name="header"><h:outputText value="#{messages.e_item_msg}" /></f:facet>
	    		<br />
	    		<table>
	    			<tr>
	    				<td>
	    					<h:outputText value="#{messages.application_msg}" />
	    				</td>
	    				<td>
	    					<h:outputText value="#{kItemAvalableManager.item.application.getName(klang)}" />
	    				</td>
	    			</tr>
	    			<tr>
	    				<td>
	    					<h:outputText value="#{messages.item_type_msg}" />
	    				</td>
	    				<td>
	    					<h:outputText value="#{kItemAvalableManager.item.itemType.getName(klang)}" />
	    				</td>
	    			</tr>
	    			<tr>
	    				<td>
	    					<h:outputText value="#{messages.active_msg}" />
	    				</td>
	    				<td>
	    					<h:selectBooleanCheckbox value="#{kItemAvalableManager.item.active}" disabled="true"/>
	    				</td>
	    			</tr>
	    		</table>
	   		</rich:panel>
	    	<br />
	   		<s:fragment id="avb_id" rendered="#{kItemAvalableManager.item.id gt 0}">
		   		<rich:panel id="avb_panel">
		  			<f:facet name="header">
						<h:outputText value="#{messages.upload_images_msg}" />
					</f:facet>
				   	<h:form>
				   		<a:commandButton value="#{messages.back_msg}" action="#{kItemAvalableManager.back()}" immediate="true"/>
			    		<rich:spacer width="10" />
			    		<a:commandButton value="#{messages.save_msg}" action="#{kItemAvalableManager.save()}" reRender="root_id"/>
				   		<table>
							<tr>
			    				<td>
			    					<h:outputText value="#{messages.color_msg}" />
			    				</td>
			    				<td>
			    					<rich:listShuttle targetValue="#{kItemAvalableManager.scolor}"  sourceValue="#{kItemAvalableManager.acolor}" 
			    						var="e" 
			    						targetCaptionLabel="#{messages.selected_msg}"
			    						sourceCaptionLabel="#{messages.available_msg}"
			    						converter="org.jboss.seam.ui.EntityConverter" > 
			    						<rich:column>
			    							<h:outputText value="#{e.color.getName(klang)}" />
			    						</rich:column>
							        </rich:listShuttle>
			    				</td>
			    			</tr>
	  						<tr>
			    				<td>
			    					<h:outputText value="#{messages.size_msg}" />
			    				</td>
			    				<td>
			    					<rich:listShuttle targetValue="#{kItemAvalableManager.ssize}"  sourceValue="#{kItemAvalableManager.asize}" 
			    						var="e"
			    						targetCaptionLabel="#{messages.selected_msg}"
			    						sourceCaptionLabel="#{messages.available_msg}"
			    						converter="org.jboss.seam.ui.EntityConverter" > 
			    						<rich:column>
			    							<h:outputText value="#{e.size.code}" />
			    						</rich:column>
							        </rich:listShuttle>
			    				</td>
			    			</tr>
	  						<tr>
			    				<td>
			    					<h:outputText value="#{messages.material_msg}" />
			    				</td>
			    				<td>
			    					<rich:listShuttle targetValue="#{kItemAvalableManager.smaterial}"  sourceValue="#{kItemAvalableManager.amaterial}" 
			    						var="e"
			    						targetCaptionLabel="#{messages.selected_msg}"
			    						sourceCaptionLabel="#{messages.available_msg}"
			    						converter="org.jboss.seam.ui.EntityConverter" > 
			    						<rich:column>
			    							<h:outputText value="#{e.material.getName(klang)}" />
			    						</rich:column>
							        </rich:listShuttle>
			    				</td>
			    			</tr>
						</table>
				   	</h:form>
				</rich:panel>
	   		</s:fragment>
   		</s:fragment>
   		<s:fragment id="error_id" rendered="#{kItemAvalableManager.error}">
   			<h:outputText value="#{messages.error_loading_page_msg}" />
   			<h:form>
	   			<h:commandLink value="#{messages.home_msg}" action="home" immediate="true"/>
   			</h:form>
   		</s:fragment>
    </ui:define>
</ui:composition>